]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
More global-ization
authorDan Winship <danw@gnome.org>
Fri, 11 Sep 2009 21:23:23 +0000 (17:23 -0400)
committerDan Winship <danw@gnome.org>
Fri, 11 Sep 2009 21:23:42 +0000 (17:23 -0400)
js/ui/appDisplay.js
js/ui/appIcon.js
js/ui/docDisplay.js
js/ui/lookingGlass.js
js/ui/panel.js
js/ui/sidebar.js
js/ui/windowManager.js
js/ui/workspaces.js

index c12f57529bdaf2abc777903b2590a96017e24c00..39bf74778b9828e30b6f82034badecdeee08c581 100644 (file)
@@ -507,8 +507,6 @@ WellMenu.prototype = {
         }));
         this.actor.add_actor(this._arrow);
 
-        let stage = Shell.Global.get().stage;
-
         // Chain our visibility and lifecycle to that of the source
         source.actor.connect('notify::mapped', Lang.bind(this, function () {
             if (!source.actor.mapped)
@@ -516,7 +514,7 @@ WellMenu.prototype = {
         }));
         source.actor.connect('destroy', Lang.bind(this, function () { this.actor.destroy(); }));
 
-        stage.add_actor(this.actor);
+        global.stage.add_actor(this.actor);
     },
 
     _getPreferredWidth: function(actor, forHeight, alloc) {
@@ -568,7 +566,7 @@ WellMenu.prototype = {
             }
         }
 
-        let activeWorkspace = Shell.Global.get().screen.get_active_workspace();
+        let activeWorkspace = global.screen.get_active_workspace();
 
         let currentWorkspaceWindows = windows.filter(function (w) {
             return w.get_workspace() == activeWorkspace;
index 6cc5fd909fb5596cce33d538f827cfcb48a34385..5ca1cfd354867b812f7a7878c80c8ca2e6240e47 100644 (file)
@@ -58,7 +58,7 @@ AppIcon.prototype = {
                                         text: appInfo.get_name() });
         nameBox.add_actor(this._name);
         this._glowBox = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL });
-        let glowPath = GLib.filename_to_uri(Shell.Global.get().imagedir + 'app-well-glow.png', '');
+        let glowPath = GLib.filename_to_uri(global.imagedir + 'app-well-glow.png', '');
         for (let i = 0; i < this._windows.length && i < 3; i++) {
             let glow = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
                                                                           glowPath, -1, -1);
index dcb29ea36aade1b2be5089e6cd8b44392c8c313f..11f9039feffbe2f151a945c91a7e621ce0f81466 100644 (file)
@@ -102,7 +102,7 @@ DocDisplayItem.prototype = {
     _resetTimeDisplay: function(currentSecs) {
         let lastSecs = this._docInfo.timestamp;
         let timeDelta = currentSecs - lastSecs;
-        let [text, nextUpdate] = Shell.Global.get().format_time_relative_pretty(timeDelta);
+        let [text, nextUpdate] = global.format_time_relative_pretty(timeDelta);
         this._timeoutTime = currentSecs + nextUpdate;
         this._setDescriptionText(text);
     }
index 120af3279f433aea6e575e6deb5bf2b7b3c6490e..cd83b923862db610399547408acf1d900c6bd4c5 100644 (file)
@@ -35,7 +35,6 @@ var commandHeader = "const Clutter = imports.gi.Clutter; " +
                     "const Tweener = imports.ui.tweener; " +
                     /* Utility functions...we should probably be able to use these
                      * in the shell core code too. */
-                    "const global = Shell.Global.get(); " +
                     "const stage = global.stage; " +
                     "const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; " +
                     /* Special lookingGlass functions */
@@ -519,8 +518,7 @@ LookingGlass.prototype = {
     },
 
     _resizeTo: function(actor) {
-        let stage = Shell.Global.get().stage;
-        let stageWidth = stage.width;
+        let stage = global.stage;
         let myWidth = stage.width * 0.7;
         let myHeight = stage.height * 0.7;
         let [srcX, srcY] = actor.get_transformed_position();
index 3ef12c2f71f298c0a8d8f23e267b0fe69e4528d6..2fbc1d89c841e9824fba5b85c6d2f4493b5cf8f9 100644 (file)
@@ -66,7 +66,7 @@ function AppPanelMenu() {
 
 AppPanelMenu.prototype = {
     _init: function() {
-        this._metaDisplay = Shell.Global.get().screen.get_display();
+        this._metaDisplay = global.screen.get_display();
 
         this._focusedApp = null;
         this._activeSequence = null;
index 840b39e0ca4cb0e4254374c1e019c5e4fe458d9a..9e2ebd39662e3738904cea27e5082a985adf69b1 100644 (file)
@@ -21,13 +21,6 @@ const SIDEBAR_PADDING = 4;
 const SIDEBAR_COLLAPSED_WIDTH = Widget.COLLAPSED_WIDTH + 3 * WidgetBox.WIDGETBOX_PADDING + SIDEBAR_PADDING;
 const SIDEBAR_EXPANDED_WIDTH = Widget.EXPANDED_WIDTH + 3 * WidgetBox.WIDGETBOX_PADDING + SIDEBAR_PADDING;
 
-// The maximum height of the sidebar would be extending from just
-// below the panel to just above the taskbar. Since the taskbar is
-// just a temporary hack and it would be too hard to do this the right
-// way, we just hardcode its size.
-const HARDCODED_TASKBAR_HEIGHT = 24;
-const MAXIMUM_SIDEBAR_HEIGHT = Shell.Global.get().screen_height - Panel.PANEL_HEIGHT - HARDCODED_TASKBAR_HEIGHT;
-
 function Sidebar() {
     this._init();
 }
index da03878c7eff1e749189cc00affa5ea58ef571d2..73303db5d94e339538224724abd0083e7ad1fdfa 100644 (file)
@@ -3,7 +3,6 @@
 const Clutter = imports.gi.Clutter;
 const Mainloop = imports.mainloop;
 const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
 
 const AltTab = imports.ui.altTab;
 const Main = imports.ui.main;
@@ -19,8 +18,7 @@ WindowManager.prototype = {
     _init : function() {
         let me = this;
 
-        this._global = Shell.Global.get();
-        this._shellwm = this._global.window_manager;
+        this._shellwm = global.window_manager;
         this._minimizing = [];
         this._maximizing = [];
         this._unmaximizing = [];
@@ -255,20 +253,20 @@ WindowManager.prototype = {
         if (direction == Meta.MotionDirection.UP ||
             direction == Meta.MotionDirection.UP_LEFT ||
             direction == Meta.MotionDirection.UP_RIGHT)
-                yDest = this._global.screen_height;
+                yDest = global.screen_height;
         else if (direction == Meta.MotionDirection.DOWN ||
             direction == Meta.MotionDirection.DOWN_LEFT ||
             direction == Meta.MotionDirection.DOWN_RIGHT)
-                yDest = -this._global.screen_height;
+                yDest = -global.screen_height;
 
         if (direction == Meta.MotionDirection.LEFT ||
             direction == Meta.MotionDirection.UP_LEFT ||
             direction == Meta.MotionDirection.DOWN_LEFT)
-                xDest = this._global.screen_width;
+                xDest = global.screen_width;
         else if (direction == Meta.MotionDirection.RIGHT ||
                  direction == Meta.MotionDirection.UP_RIGHT ||
                  direction == Meta.MotionDirection.DOWN_RIGHT)
-                xDest = -this._global.screen_width;
+                xDest = -global.screen_width;
 
         let switchData = {};
         this._switchData = switchData;
@@ -276,7 +274,7 @@ WindowManager.prototype = {
         switchData.outGroup = new Clutter.Group();
         switchData.windows = [];
 
-        let wgroup = this._global.window_group;
+        let wgroup = global.window_group;
         wgroup.add_actor(switchData.inGroup);
         wgroup.add_actor(switchData.outGroup);
 
index 5bd33a929ac5232807fbd1c25e3e34e335c4d75b..39c48b5aecc6ab0897281e71be5414529af222b3 100644 (file)
@@ -1102,7 +1102,7 @@ Workspaces.prototype = {
             }
         }
         activeWorkspace.actor.raise_top();
-        this._positionWorkspaces(global);
+        this._positionWorkspaces();
 
         let lastWorkspace = this._workspaces[this._workspaces.length - 1];
         lastWorkspace.updateRemovable(true);
@@ -1196,7 +1196,7 @@ Workspaces.prototype = {
         let activeWorkspaceIndex = global.screen.get_active_workspace_index();
         let activeWorkspace = this._workspaces[activeWorkspaceIndex];
 
-        this._positionWorkspaces(global);
+        this._positionWorkspaces();
         activeWorkspace.actor.raise_top();
 
         for (let w = 0; w < this._workspaces.length; w++)
@@ -1237,7 +1237,7 @@ Workspaces.prototype = {
     // first row.)
     //
     // FIXME: need to make the metacity internal layout agree with this!
-    _positionWorkspaces : function(global) {
+    _positionWorkspaces : function() {
         let gridWidth = Math.ceil(Math.sqrt(this._workspaces.length));
         let gridHeight = Math.ceil(this._workspaces.length / gridWidth);
 
@@ -1307,7 +1307,7 @@ Workspaces.prototype = {
         newLastWorkspace.updateRemovable();
 
         // Figure out the new layout
-        this._positionWorkspaces(global);
+        this._positionWorkspaces();
         let newScale = this._workspaces[0].scale;
         let newGridWidth = Math.ceil(Math.sqrt(newNumWorkspaces));
         let newGridHeight = Math.ceil(newNumWorkspaces / newGridWidth);